<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>我的收藏</title>
<link rel="stylesheet" type="text/css" href="css/hui.css" />
</head>
<body>
<header class="hui-header" style="background: red;">
    <div id="hui-back"></div>
    <h1>我的收藏</h1>
</header>
<div class="hui-wrap">
    <div class="hui-media-list" style="padding:18px 5px;">
        <div class="hui-refresh-icon"></div>
        <ul id="MainList"></ul>
    </div>
</div>
<script type="text/javascript" src="js/hui.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/hui-refresh-load-more.js"></script>
<script type="text/javascript">
var page = 1;
hui.plusReady(function(){
    loadLikes();
});
hui.immersedStatusbar();
hui.loadMore(loadLikes);
function loadLikes(){
    var SUID  = hui.getItem('SUID');
    var SRAND = hui.getItem('SRAND');
    hui.postJSON(
        'http://shop.hcoder.net/myApi.php',
        {act:"goodsLikeList", suid : SUID, srand : SRAND, page : page},
        function(res){
            if(page > 1){hui.endLoadMore();}
            if(res.msg == 'null'){
                hui.endLoadMore(true);
                return false;
            }
            for(var i = 0; i < res.msg.length; i++){
                var li = document.createElement('li');
                li.innerHTML = '<a href="javascript:showInfo(\''+res.msg[i].goods_id+'\');">'+
                    '<div class="hui-media-list-img"><img src="http://shop.hcoder.net/'+res.msg[i].goods_thumb+'" /></div>'+
                    '<div class="hui-media-content">'+
                        '<h1>['+res.msg[i].goods_id+'] '+res.msg[i].goods_name+'</h1>'+
                         '<p>￥'+res.msg[i].shop_price+'</p>'+
                    '</div>'
                '</a>';
                hui(li).appendTo('#MainList');
            }
            page++;
        }
    );
}
</script>
</body>
</html>